How to list all tables in a schema in Oracle SQL?
How to list all tables in a schema in Oracle SQL?
571
17-Jul-2023
Updated on 18-Jul-2023
Aryan Kumar
18-Jul-2023Sure, here is how you can list all tables in a schema in Oracle SQL:
SQL
This query will select all tables in the current user's schema. The
user_tablesview is a data dictionary view that contains information about all of the tables in the schema.The
table_namecolumn contains the name of the table.To run this query, you will need to connect to the Oracle database using a tool like SQLPlus. Once you are connected, you can run the query by typing it into the SQLPlus prompt.
For example, to run the query above, you would type the following into the SQL*Plus prompt:
SQL
This would return a list of all tables in the current user's schema.
You can also use the
all_tablesview to list all tables in the database, including tables that are owned by other users.Here is the syntax for the
all_tablesview:SQL
To run this query, you will need to have the
DBArole or be granted theSELECTprivilege on theall_tablesview.